package pers.qianyu.month_202103.date_20210319;

/**
 * 1603. 设计停车系统
 * https://leetcode-cn.com/problems/design-parking-system/
 * 就这??
 *
 * @date 2021-03-19 15:12
 */
public class ParkingSystem {
    private int big, medium, small;

    public ParkingSystem(int big, int medium, int small) {
        this.big = big;
        this.medium = medium;
        this.small = small;
    }

    public boolean addCar(int carType) {
        if (carType == 1) {
            if (big == 0) {
                return false;
            } else {
                big--;
                return true;
            }
        } else if (carType == 2) {
            if (medium == 0) {
                return false;
            } else {
                medium--;
                return true;
            }
        } else if (carType == 3) {
            if (small == 0) {
                return false;
            } else {
                small--;
                return true;
            }
        } else {
            return false;
        }
    }
}
